package com.bjdd.jdy.ui.exam;

import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.entity.ExamBean;
import com.bjdd.jdy.entity.ExamResult;
import com.bjdd.jdy.util.Api;
import com.bjdd.jdy.util.RxSchedulers;

import java.util.List;

import rx.Observable;

/**
 * Created by Administrator on 2017/4/13.
 */

public class ExamModel implements ExamContract.Model {
    @Override
    public Observable<BaseResult<ExamResult>> getExamModel(String token, String carrierId) {
        return Api.getInstance().service
                .getExam(token,carrierId)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> commitExam(String token,int chapter,String carrierId) {
        return Api.getInstance().service
                .passExam(token,chapter,carrierId)
                .compose(RxSchedulers.io_main());
    }
}
